function init(){
	intercut;
   	pagecut;
   	codecut;
   	localcut;
   	buttoncut;
}
var intercut = (function(){
	var login = document.getElementsByClassName('login')[0];
	var qrcode = document.getElementsByClassName('qrcode')[0];
	var change = document.getElementsByClassName('change')[0];
	//重置displa的空值
	login.style.display = 'block';
	addEvent(change,'click',function(){
		if(login.style.display == 'block'){
			login.style.display = 'none';
			qrcode.style.display = 'block';
			change.style.backgroundImage = 'url("../images/下载 (1.png")';
		}else{
			login.style.display = 'block';
			qrcode.style.display = 'none';
			change.style.backgroundImage = 'url("../images/下载.png")';
		}
	});
}());
var pagecut = (function(){
	var message = document.getElementsByClassName('message')[0];
	var password = document.getElementsByClassName('password')[0];
	var locka = document.getElementsByClassName('lock1')[0];
	var lockb = document.getElementsByClassName('lock2')[0];
	addEvent(locka,'click',function(){
		password.style.display = 'none';
		message.style.display = 'block';
		locka.className = 'selected lock1';
		lockb.className = 'lock2';
	});
	addEvent(lockb,'click',function(){
		password.style.display = 'block';
		message.style.display = 'none';
		locka.className = 'lock1';
		lockb.className = 'selected lock2';
	});
}());
var codecut = (function(){
	var txt = document.getElementsByClassName('code_txt')[0];
	var lock = document.getElementsByClassName('area_lock')[0];
	var area = document.getElementsByClassName('choose_area')[0];
	addEvent(txt,'click',function(){
		area.style.display = 'block';
	});
	addEvent(lock,'click',function(){
		area.style.display = 'none';
	});
}());
var localcut = (function(){
	var li = document.querySelectorAll('div.center > ul li');
	var start = document.querySelector('div.top_a div.code_txt');
	var span = document.querySelectorAll('div.center ul li span.fr');
	start.innerText = span[0].innerText;
	for(var i = 0;i<5;i++){
		(function(k){
			addEvent(li[k],'click',function(){
				li[k].className = 'clearFix selected';
				start.innerText = span[k].innerText;
				for(var j = 0;j<5;j++){
					(function(g){
						if(g != k){
							li[g].className = 'clearFix';
						}
					}(j))
				}
				return k;
			});
		}(i));
	}
}());
var buttoncut = (function(){
	var input = document.querySelectorAll('div.login input');
	var lefta = document.querySelectorAll('div.login input')[0];
	var leftb = document.querySelectorAll('div.login input')[1];
	var righta = document.querySelectorAll('div.login input')[2];
	var rightb = document.querySelectorAll('div.login input')[3];
	var btn = document.querySelectorAll('div.btnWrap button');
	var message = document.getElementsByClassName('message')[0];
	for(var i = 0;i < 4;i++){
		(function(k){
			addEvent(input[k],'mouseout',function(){
				if((lefta.value != '' && leftb.value != '')||(message.style.display == 'block')){
					btn[0].style.backgroundColor = '#41ac52';
				}else if(righta.value != '' && rightb.value != ''){
					btn[1].style.backgroundColor = '#41ac52';
				}else{
					btn[0].style.backgroundColor = '#42bd5680';
					btn[1].style.backgroundColor = '#42bd5680';
				}
			});
		}(i))
	}
}());
var statecut = function(){
	var pointer = document.getElementsByClassName('pointer')[0];
	var change = document.getElementsByClassName('change')[0];
	var message = document.getElementsByClassName('message')[0];
	console.log(message)
	addEvent(change,'click',function(){
		if(message.style.display == 'block' || message.style.display == ''){
			pointer.innerHTML = '扫码登录';
		}else{
			pointer.innerHTML = '短信登录/注册';
		}
		console.log(message.style.display);
	});
}